//
//  Student.m
//  03-23-PM-单例
//
//  Created by student on 16/3/23.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "Student.h"
//方式1:GCD
static Student *instance = nil;
@implementation Student

+(instancetype)allocWithZone:(struct _NSZone *)zone
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[Student alloc]init];
    });
    return instance;
}



+(Student *)shareStudent
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        instance = [[Student alloc]init];
    });
    return instance;
}


@end
